Hydrocarbons in a reservoir are trapped by overlying rock formations with lower permeability functioning as a seal layer, also referred to as a cap layer or cap rock. Thus, in order to access the contents of the hydrocarbon-containing reservoir, it is usually necessary to drill through the seal layer if the reservoir is not just seeping and does not have such a seal layer. When completing a well, the first and upper part of the well is drilled, and the seal layer is then penetrated. Subsequently, the casing strings are run into the hole and are each sealed by cement pumped down through the casing shoe and further out of the bottom of the borehole and upwards into the annulus surrounding the casing to fill up the annulus between the casing and the borehole wall to create a seal. When pumping cement down the casing, corresponding to filling up the annulus to the required height, e.g. 200 meters, a cemented shoe-track is created at the bottom of the casing string. After some curing time, the cemented shoe-track is drilled out and the lower part of the well is completed by drilling into the reservoir. The cement is presumed to seal between the cap rock and the casing, but the cement cannot be tested by pressurisation from below the cement, since the pressurised fluid would leak out through the formation below the seal layer. Thus, whether or not the cement forms a proper seal against the cap rock cannot be tested before drilling further into the formation, opening the reservoir and thus releasing the reservoir pressure. Many types of cement, e.g. cement having radioactive particles, have been used in for testing the sealing property of the cement, but none of these attempts have been very successful. Therefore, today many wells are leaking because the cement does not seal sufficiently.